$(document).ready(function () {
    // 客源地数据
    var datas = [1510, 2205, 4467, 8931, 15816];
    var cityData = ['河南', '山西','陕西','河北','江苏']
    var cityDataBack =  ['河南', '山西','陕西','河北','江苏']
    // 客源地点击切换
    $('.content-title >.change').click(function(){
        console.log(1)
        $(this).siblings('p').toggleClass('hd')
        if($(this).siblings('p').eq(0).hasClass('hd')){
            datas = [1437, 1844, 5464, 6867, 9412];
            cityData = ['郑州','洛阳', '焦作','新乡','南阳']
            cityDataBack =  ['郑州','洛阳', '焦作','新乡','南阳']
            myChart7()
        }else {
            datas = [1510, 2205, 4467, 8931, 15816];
            cityData = ['河南', '山西','陕西','河北','江苏']
            cityDataBack =  ['河南', '山西','陕西','河北','江苏']
            myChart7()
        }
    })
    // 重点景区客流
    function myChart1_1() {
        var myChart = echarts.init(document.getElementById('index1-1'));
        let data1 = [220, 182, 231, 264,120, 320, 310, 262, 251, 234, 290, 330]//白云山
        let data2 = [200, 162, 201, 234, 100, 310, 300,241, 234, 200, 260, 310]//天池山
        let data3 = [180, 142, 181, 204, 90, 300, 280,210, 220, 190, 240, 300]//木扎岭
        let data4 = [160, 132, 161, 184, 80, 270, 260, 182, 201, 174, 210, 280]//白云小镇
        let data5 = [140, 112, 141, 164, 70, 240, 230,161, 174, 160, 190, 260]//石头部落
        // let data6 = [120, 92, 121, 134, 60, 210, 200,140, 150, 140, 160, 240]//栖龙湾
        // let data7 = [100, 72, 101, 104, 50, 190, 180,120, 130, 110, 140, 220]//聚寿山
        option ={

            grid: {
                left: '-4%',
                right: '-6%',
                top:'30%',
                bottom: '8%',
                containLabel: true
            },
            tooltip : {
                show: true,
                trigger: 'axis',

            },
            legend: {
                show:true,
                icon: 'stack',
                itemWidth:8,
                itemHeight:8,
                textStyle:{
                    color:'#1bb4f6',
                    fontSize:12
                },
                data:['白云山','天池山','木扎岭','白云小镇','石头部落']
            },
            xAxis : [
                {
                    type : 'category',
                    boundaryGap : false,
                    axisLabel:{
                        color: '#333'
                    },
                    axisLine:{
                        show:true,
                        lineStyle:{
                            color:'rgba(46,166,255,0.5)'
                        }
                    },
                    axisLabel : {

                        textStyle:{
                            color:'rgba(255,255,255,0.5)'
                        }
                    },
                    axisTick:{
                        show:false,
                    },
                    splitLine:{
                        show:false,
                        lineStyle:{
                            color:'#195384'
                        }
                    },
                    data : ['8:00','9:00','10:00','11:00','12:00','13:00','14:00','15:00','16:00','17:00','18:00']
                }
            ],
            yAxis : [
                {
                    type : 'value',
                    min:0,
                    max:2000,
                    show:false,
                    axisLabel : {
                        formatter: '{value}',
                        textStyle:{
                            color:'#2ad1d2'
                        }
                    },
                    axisLine:{
                        lineStyle:{
                            color:'#27b4c2'
                        }
                    },
                    axisTick:{
                        show:false,
                    },
                    splitLine:{
                        show:true,
                        lineStyle:{
                            color:'#11366e'
                        }
                    }
                },
                {
                    type : 'value',
                    min:0,
                    max:1000,
                    show:false,
                    axisLabel : {
                        formatter: '{value} 人',
                        textStyle:{
                            color:'#186afe'
                        }
                    },
                    axisLine:{
                        lineStyle:{
                            color:'#186afe'
                        }
                    },
                    axisTick:{
                        show:false,
                    },
                    splitLine:{
                        show:true,
                        lineStyle:{
                            color:'#11366e'
                        }
                    }
                }
            ],
            series : [
                {
                    name:'白云山',
                    type:'line',
                    stack: '总量',
                    smooth: true,
                    symbol:'circle',
                    symbolSize: 6,
                    itemStyle: {
                        normal: {
                            color:'#FF5959',
                            lineStyle: {
                                color: "#FF5959",
                                width:1
                            },

                        }
                    },
                    markPoint:{
                        itemStyle:{
                            normal:{
                                color:'red'
                            }
                        }
                    },
                    data:data1
                },
                {
                    name:'天池山',
                    type:'line',
                    stack: '总量',
                    smooth: true,
                    symbol:'circle',
                    symbolSize: 0,

                    itemStyle: {
                        normal: {
                            color:'#00E4FF',
                            lineStyle: {
                                color: "#00E4FF",
                                width:1
                            },

                        }
                    },
                    data:data2
                },
                {
                    name:'木扎岭',
                    type:'line',
                    stack: '总量',
                    smooth: true,
                    symbol:'circle',
                    symbolSize: 0,
                    itemStyle: {
                        normal: {
                            color: '#53FCB3',
                            lineStyle: {
                                color: "#53FCB3",
                                width:1
                            },

                        }
                    },
                    data:data3
                },
                {
                    name:'白云小镇',
                    type:'line',
                    stack: '总量',
                    smooth: true,
                    symbol:'circle',
                    symbolSize: 6,
                    itemStyle: {
                        normal: {
                            color:'#f7ac1a',
                            lineStyle: {
                                color: "#f7ac1a",
                                width:1
                            },

                        }
                    },
                    markPoint:{
                        itemStyle:{
                            normal:{
                                color:'red'
                            }
                        }
                    },
                    data:data4
                },
                {
                    name:'石头部落',
                    type:'line',
                    stack: '总量',
                    smooth: true,
                    symbol:'circle',
                    symbolSize: 0,

                    itemStyle: {
                        normal: {
                            color:'#ff5959',
                            lineStyle: {
                                color: "#ff5959",
                                width:1
                            },

                        }
                    },
                    data:data5
                },
                // {
                //     name:'栖龙湾',
                //     type:'line',
                //     stack: '总量',
                //     smooth: true,
                //     symbol:'circle',
                //     symbolSize: 0,
                //     itemStyle: {
                //         normal: {
                //             color: '#1C86F1',
                //             lineStyle: {
                //                 color: "#1C86F1",
                //                 width:1
                //             },
                //
                //         }
                //     },
                //     data:data6
                // },
                // {
                //     name:'聚寿山',
                //     type:'line',
                //     stack: '总量',
                //     smooth: true,
                //     symbol:'circle',
                //     symbolSize: 0,
                //     itemStyle: {
                //         normal: {
                //             color: '#9A4CFB',
                //             lineStyle: {
                //                 color: "#9A4CFB",
                //                 width:1
                //             },
                //
                //         }
                //     },
                //     data:data7
                // }
            ]
        };

        myChart.setOption(option);
    }
    // 网络评价好中差评占比
    function myChart1_2_1() {
        var myChart = echarts.init(document.getElementById('index1-2-1'));
        let data = [
            { value: 33, name: '好评' },
            { value: 33, name: '中评' },
            { value: 34, name: '差评' }
        ]
        var color =  ['#9A4CFB', '#4B66C7', '#44D798']

        var seriesData = data.map((item, index) => {
            return {
                name: item.name,
                value: item.value,
            }
        })
        var option = {
            title: {
                    text: '景区',
                    textStyle: {
                        fontSize: 12,
                        color: "#fff"
                    },
                x: "center"
                },
                series: [
                {
                    name: '渠道分析',
                    type: 'pie',
                    radius: '60%',
                    center: ['50%', '50%'],
                    data: seriesData,
                    color: color,
                    labelLine: {
                        normal: {
                            length: 20,
                            length2: 30,
                            lineStyle: {
                                type: 'solid'
                            }
                        }

                    },
                    label: {
                        normal: {
                            formatter: function (params) {
                                if (params.dataIndex === 0) {
                                    return '{color1|' + params.value + '%}' + '\n{black|' + params.name + '}'
                                } else if (params.dataIndex === 1) {
                                    return '{color2|' + params.value + '%}' + '\n{black|' + params.name + '}'
                                } else if (params.dataIndex === 2) {
                                    return '{color3|' + params.value + '%}' + '\n{black|' + params.name + '}'
                                }
                            },
                            rich: {
                                black: {
                                    color: '#666',
                                    padding: [5, -28],
                                    textAlign: 'left',
                                    fontSize: '14px',
                                    fontFamily: 'PingFangSC'
                                },
                                color1: {
                                    padding: [5, -28],
                                    textAlign: 'left',
                                    fontWeight: 700,
                                    fontFamily: 'PingFangSC',
                                    color: '#9A4CFB'
                                },
                                color2: {
                                    padding: [5, -28],
                                    textAlign: 'left',
                                    fontWeight: 700,
                                    fontFamily: 'PingFangSC',
                                    color: '#4B66C7'
                                },
                                color3: {
                                    padding: [5, -28],
                                    textAlign: 'left',
                                    fontWeight: 700,
                                    fontFamily: 'PingFangSC',
                                    color: '#44D798'
                                }
                            }
                        }
                    },
                    itemStyle: {
                        emphasis: {
                            shadowBlur: 10,
                            shadowOffsetX: 0,
                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                        }
                    }
                }
            ]
        }

        myChart.setOption(option);
    }
    function myChart1_2_2() {
        var myChart = echarts.init(document.getElementById('index1-2-2'));
        let data = [
            { value: 33, name: '好评' },
            { value: 33, name: '中评' },
            { value: 34, name: '差评' }
        ]
        var color =  ['#9A4CFB', '#4B66C7', '#44D798']

        var seriesData = data.map((item, index) => {
            return {
                name: item.name,
                value: item.value,
            }
        })
        var option = {
            title: {
                text: '酒店',
                textStyle: {
                    fontSize: 12,
                    color: "#fff"
                },
                x: "center"
            },
            series: [
                {
                    name: '渠道分析',
                    type: 'pie',
                    radius: '60%',
                    center: ['50%', '50%'],
                    data: seriesData,
                    color: color,
                    labelLine: {
                        normal: {
                            length: 20,
                            length2: 30,
                            lineStyle: {
                                type: 'solid'
                            }
                        }

                    },
                    label: {
                        normal: {
                            formatter: function (params) {
                                if (params.dataIndex === 0) {
                                    return '{color1|' + params.value + '%}' + '\n{black|' + params.name + '}'
                                } else if (params.dataIndex === 1) {
                                    return '{color2|' + params.value + '%}' + '\n{black|' + params.name + '}'
                                } else if (params.dataIndex === 2) {
                                    return '{color3|' + params.value + '%}' + '\n{black|' + params.name + '}'
                                }
                            },
                            rich: {
                                black: {
                                    color: '#666',
                                    padding: [5, -28],
                                    textAlign: 'left',
                                    fontSize: '14px',
                                    fontFamily: 'PingFangSC'
                                },
                                color1: {
                                    padding: [5, -28],
                                    textAlign: 'left',
                                    fontWeight: 700,
                                    fontFamily: 'PingFangSC',
                                    color: '#9A4CFB'
                                },
                                color2: {
                                    padding: [5, -28],
                                    textAlign: 'left',
                                    fontWeight: 700,
                                    fontFamily: 'PingFangSC',
                                    color: '#4B66C7'
                                },
                                color3: {
                                    padding: [5, -28],
                                    textAlign: 'left',
                                    fontWeight: 700,
                                    fontFamily: 'PingFangSC',
                                    color: '#44D798'
                                }
                            }
                        }
                    },
                    itemStyle: {
                        emphasis: {
                            shadowBlur: 10,
                            shadowOffsetX: 0,
                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                        }
                    }
                }
            ]
        }

        myChart.setOption(option);
    }
    // 近七天客流量
    function myChart3() {
        var myChart = echarts.init(document.getElementById('index_3'));
        let data = [53926, 53971, 52062, 52885, 54600, 57576, 55816];//数据

        option = {
            grid: {
                top: '20px',
                left: '20px',
                bottom: "35px",
                right: "16px"
            },
            legend: {
                show:true,
                right:'20',
                icon: 'stack',
                itemWidth:10,
                itemHeight:10,
                textStyle:{
                    color:'#fff'
                },
            },
            tooltip: {
                show: true,
                trigger:'axis'
            },
            xAxis: {
                type: 'category',
                data: ['5-25', '5-26', '5-27', '5-28', '5-29', '5-30', '5-31'],
                splitLine: {
                    show: false
                },
                axisLine: {
                    lineStyle: {
                        color: "rgba(46,166,255,.5)"
                    }
                }
            },
            yAxis: {
                type: 'value',
                max: 100000,
                axisLabel: {
                    show: false
                },
                splitLine: {
                    show: false
                },
                axisTick: {
                    show: false
                },
                axisLine: {
                    show: false
                },
            },
            series: [
                {
                    data: data,
                    type: 'line',
                    smooth: true,
                    symbol: "circle",
                    name: '客流量(人次)',
                    symbolSize: 2, // 控制线条上 点 的大小
                    lineStyle: {
                        color: '#fe5959'
                    },
                    areaStyle: { //区域填充样式
                        normal: {
                            //线性渐变，前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’，则该四个值是绝对像素位置。
                            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                                offset: 0,
                                color: 'rgba(244,86,84,.6)'
                            },
                                {
                                    offset: 1,
                                    color: 'rgba(244,86,84,0)'
                                }
                            ], false),
                            shadowColor: 'rgba(244,86,84,.6)', //阴影颜色
                            shadowBlur: 20 //shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。
                        }
                    },
                    label: {
                        show: true,
                        position: 'top',
                        textStyle: {
                            color: '#fff',
                        }
                    },
                }
            ]
        };

        myChart.setOption(option);
    }

    // 年龄性别占比
    function myChart4() {
        var myChart = echarts.init(document.getElementById('index_4'));
        var symbols = [
            'path://M115.3,45.3H104c5.7-1.9,9.8-7.2,9.8-13.5c0-7.8-6.4-14.2-14.2-14.2c-7.8,0-14.2,6.4-14.2,14.2c0,6.3,4.1,11.6,9.8,13.5  H83.8c-10,0-18.3,8.1-18.3,18.2v44c0,3.4,2.7,6.2,6.1,6.2c3.4,0,6.2-2.8,6.2-6.2V67.9H81v110.5c0,4.6,3.8,8.3,8.4,8.3  c4.6,0,8.3-3.7,8.3-8.3v-64.1h3.4v64.1c0,4.6,3.7,8.3,8.3,8.3c4.6,0,8.4-3.7,8.4-8.3V67.9h3.2v39.7c0,3.4,2.8,6.2,6.2,6.2  s6.1-2.8,6.1-6.2v-44C133.6,53.5,125.4,45.3,115.3,45.3z',
            'path://M135.6,99.4l-11.4-39.7c-4.6-15.9-17.8-15.4-17.8-15.4h-5.2c5.1-2.2,8.6-7.3,8.6-13.1c0-8-6.5-14.4-14.5-14.4  c-8,0-14.5,6.4-14.5,14.4c0,5.9,3.5,10.9,8.6,13.1h-5.1c0,0-13.3-0.5-17.8,15.4L55,99.4c-1.1,3.7,1,6.5,4.2,7.5  c3.2,0.9,6.5-0.7,7.4-3.7l11.1-38.7h3l-19.2,67h18.1v49.1c0,3.7,3.2,6.9,7.1,6.9c3.5,0,7.1-3.5,7.1-7.2v-48.8h2.9v48.8  c0,3.7,3.6,7.2,7.1,7.2c3.9,0,7.1-3.1,7.1-6.9v-49.1H129l-19.2-67h3l11.1,38.7c0.8,3,4.2,4.6,7.4,3.7  C134.6,105.9,136.6,103.1,135.6,99.4z',
        ];
        // 年龄数据
        let ageData = [
            {value: 0, name: '18岁以下'},
            {value: 10.72, name: '18-24岁'},
            {value: 36.92, name: '25-39岁'},
            {value: 30.8, name: '40-59岁'},
            {value: 13.57, name: '60岁以上'}
        ]
        let color=['#4B66C7','#9A4CFB','#E76D59','#53FCB3','#00E4FF']
        var bodyMax = 100;
        option = {
            color:color,
            legend: {
                show:false,
                right: "16px",
                top:'0px',
                data: ['18岁以下','18-24岁','25-39岁','40-59岁','60岁以上'],
                itemWidth:6,
                itemHeight:6,
                textStyle:{
                    color:"#fff",
                    fontSize:12
                }
            },
            grid: {
                left: '10%',
                right: '60%',
                top: '30%',
                bottom: "20%"
            },
            xAxis: {
                show: false,
                data: ['男', '女',],
                axisTick: {show: false},
                axisLine: {show: false},
                axisLabel: {show: false}
            },
            yAxis: {
                show: false,
            },

            markLine: {
                z: -100
            },

            tooltip: {
                show: true,
                trigger:'item',
                borderColor:'#2EA6FF',
                formatter:function (params) {
                    return params.data.name+'<br>'+params.marker+params.data.value+'%'
                }
            },
            series: [
                {
                    name: '人数',
                    type: 'pictorialBar',
                    symbolClip: true,
                    symbolBoundingData: bodyMax,
                    data: [{
                        name:'男生占比',
                        value:72.684 ,
                        symbol: symbols[0]
                    }, {
                        name:'女生占比',
                        value:27.316 ,
                        symbol: symbols[1]
                    },],
                    itemStyle: {
                        // color: '#fff'
                        color: (params) => {
                            let colors = ['#2ea6ff', '#ff5959',]
                            return colors[params.dataIndex]
                        }
                    },
                    z: 10,
                    symbolOffset: ["30%", 0],//柱子的位置
                    symbolSize: [30, 77],//size,单个symbol的大小
                },
                {
                    name: '总数',
                    type: 'pictorialBar',
                    symbolBoundingData: bodyMax,
                    tooltip: {
                        show: false
                    },
                    // animationDuration: 0,
                    itemStyle: {
                        // color: '#fff'
                        color: (params) => {
                            let colors = ['rgba(46,166,255,.4)', 'rgba(255,89,89,.4)',]
                            return colors[params.dataIndex]
                        }
                    },
                    data: [{
                        value: bodyMax,
                        symbol: symbols[0]
                    }, {
                        value: bodyMax,
                        symbol: symbols[1]
                    }],
                    symbolOffset: ["30%", 0],//柱子的位置
                    symbolSize: [30, 77],//size,单个symbol的大小
                },
                {
                    name: '',
                    type: 'pie',
                    radius: '45%',
                    center: ['70%', '50%'],
                    data:ageData,
                    avoidLabelOverlap: false,
                    // roseType: 'radius',
                    label: {
                        color: 'rgba(255, 255, 255, 1)'
                    },
                    labelLine: {
                        lineStyle: {
                            // color: '#fff'
                        },
                        smooth: 0.2,
                        length: 10,
                        length2: 5
                    },


                    animationType: 'scale',
                    animationEasing: 'elasticOut',
                    animationDelay: function (idx) {
                        return Math.random() * 200;
                    }
                }
            ]
        };

        myChart.setOption(option);
    }
    // 过夜游停留时长
    function myChart5() {
        var myChart = echarts.init(document.getElementById('index_5'));
        var visits = [0.8,0.2,3.1,4.3,81.5,12.5,51,19.8,]; //数值
        var grade = ['五夜以上','五夜游','四夜游','三夜游','两夜游','一夜游','隔夜游','一日游'];
        var data = {
            grade: grade,
            // totalCost: totalCost,
            visits: visits,
        };
        option = {
            grid: {
                top:'8%',
                left:'-5%',
                right: '5%',
                bottom: '-5%',
                containLabel: true

            },
            tooltip: {
                show: false
            },
            xAxis: {
                show: false
            },
            yAxis: [{
                type: 'category',

                axisTick: {
                    show: false
                },
                axisLine: {
                    show: false,
                },
                axisLabel: {
                    margin:70,
                    textStyle: {
                        align:'left',
                        fontSize: 12,
                        color: '#fff'
                    },
                },
                data: data.grade
            }, {
                show:false,
                type: 'category',

                axisLine: {
                    show: false
                },
                axisTick: {
                    show: false
                },
                axisLabel: {
                    textStyle: {
                        fontSize: 12,
                        color: '#fff',
                    },
                },
                splitArea: {
                    show: false
                },
                splitLine: {
                    show: false
                },
                data: data.visits
            }, ],
            series: [
                {

                    type: 'bar',

                    itemStyle: {
                        normal: {
                            show: true,
                            color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
                                offset: 0,
                                color: 'rgba(55,184,102,0.3)'

                            }, {
                                offset: 1,
                                color: 'rgba(55,184,102,1)'

                            }]),
                            barBorderRadius: 0,
                            borderWidth: 0,
                            borderColor: '#333',
                        }
                    },
                    label: {
                        normal: {
                            position: ['30px', '0'],
                            color:'#fff',
                            show:true,
                            formatter:function(params){
                                return params.value+'%'
                            }
                        }
                    },
                    barWidth: '30%',

                    data: data.visits
                }

            ]
        };

        myChart.setOption(option);
    }
    // 游客出行方式
    function myChart6() {
        var myChart = echarts.init(document.getElementById('index_6'));
        let color=['#4B66C7','#9A4CFB','#E76D59','#53FCB3','#00E4FF']
        // 数据
        let ageData = [
            {value: 22, name: '组团'},
            {value: 66.15, name: '自驾'},
            {value: 7.8, name: '普通火车'},
            {value: 4.05, name: '其他'}
        ]

        option = {
            color:color,
            legend: {
                show:true,
                orient:'vertical',
                right: "16px",
                itemWidth:10,
                itemHeight:6,
                textStyle:{
                    color:"#fff",
                    fontSize:12
                }
            },

            xAxis: {
                show: false,
                data: ['男', '女',],
                axisTick: {show: false},
                axisLine: {show: false},
                axisLabel: {show: false}
            },
            yAxis: {
                show: false,
            },

            markLine: {
                z: -100
            },

            tooltip: {
                show: true,
                trigger:'item',
                formatter:function (params) {
                    return params.data.name+'<br>'+params.marker+params.data.value+'%'
                }
            },
            series: [
                {
                    name:'出行方式',
                    type: 'pie',
                    radius: ['40%', '58%'],
                    center: ['50%', '50%'],
                    avoidLabelOverlap: false,
                    data: ageData,
                    itemStyle: {
                        emphasis: {
                            shadowBlur: 10,
                            shadowOffsetX: 0,
                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                        }
                    },
                    labelLine:{
                        length2:30
                    },
                    label: {
                        normal: {
                            formatter: function (params) {

                                return '{white|' + params.value + '%}'
                            },
                            rich: {
                                white: {
                                    color: '#fff',
                                    lineHeight: 20,
                                    textAlign: 'left',
                                    fontSize: '12px',
                                    fontFamily: 'PingFangSC'
                                }
                            }

                        }
                    },
                }
            ]
        };

        myChart.setOption(option);
    }
    // 客源地
    function myChart7() {
        var myChart = echarts.init(document.getElementById('index_7'));
        var myColor = chartColor;

        var sum = getsum(datas);

        function getsum(arr) {
            return arr.reduce(function (prev, curr, idx, arr) {
                return prev + curr;
            });
        }

        option = {
            grid: {
                top: '5%',
                right: '10%',
                left: '20%',
                bottom: '5%'
            },
            xAxis: {
                gridIndex: 0,
                show: false,
            },
            yAxis: {
                gridIndex: 0,
                splitLine: 'none',
                axisTick: 'none',
                axisLine: 'none',
                axisLabel: {
                    align: 'left',
                    padding: [0, 0, 0, -40],
                    textStyle: {
                        color: '#fff',
                        fontSize: '12px',
                        rich: {
                            a: {
                                fontSize: 12,
                                backgroundColor: '#E15D68',
                                borderRadius: 10,
                                padding: [2, 5],
                                textAlign: 'center',
                                color: '#fff',

                            },
                            b: {
                                fontSize: 12,
                                backgroundColor: '#FFAA25',
                                borderRadius: 10,
                                padding: [2, 5],
                                textAlign: 'center',
                                color: '#fff',
                            },
                            c: {
                                fontSize: 12,
                                backgroundColor: '#14C6CA',
                                borderRadius: 10,
                                padding: [2, 5],
                                textAlign: 'center',
                                color: '#fff',
                            },
                            d: {
                                fontSize: 12,
                                textAlign: 'center',
                                padding: [2, 4],
                                color: '#14C6CA',
                            }
                        }
                    },
                    formatter: function (params) {
                        var data = cityDataBack
                        for (var i = 0; i < 5; i++) {
                            if (data[i] == params)  {
                                var j = i + 1
                                if (i == 0) {
                                    return '{a|' + j + '} ' + params
                                }
                                if (i == 1) {
                                    return '{b|' + j + '} ' + params

                                }
                                if (i == 2) {
                                    return '{c|' + j + '} ' + params
                                }
                                if (i > 2) {
                                    return '{d| ' + j + '}' + params
                                }
                            }

                        }
                    },
                },

                data: cityData.reverse()
            },
            series: {
                name: '值',
                type: 'bar',
                xAxisIndex: 0,
                yAxisIndex: 0,
                data: datas,
                label: {
                    normal: {
                        show: true,
                        position: ['30px', '3px'],
                        offset: [0, 0],
                        color: '#fff',
                        fontSize: '12px',
                        formatter: function (item) {
                            return item.value +'人' + '\xa0\xa0 ' + (item.value / sum * 100).toFixed(2) + '%'
                        }
                    }
                },
                barWidth: '15px',
                itemStyle: {
                    normal: {
                        color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
                            offset: 0,
                            color: 'rgba(0,228,255,0.1)'
                        }, {
                            offset: 1,
                            color: 'rgba(0,228,255,1)'
                        }]),
                        barBorderRadius: 0,
                    }
                },
                z: 2
            },

        };
        myChart.setOption(option);

    }

    setTimeout( myChart1_1,1000);
    setTimeout( myChart1_2_1,5000);
    setTimeout( myChart1_2_2,5000);
    setTimeout(myChart3,3000);
    setTimeout(myChart4,6000);
    setTimeout(myChart5,7000);
    setTimeout(myChart6,9000);
    setTimeout(myChart7,10000);
    <!-- 数字 -->
    $('.numberStyle').leoTextAnimate({
        delay:1000, //延时出现时间
        autorun: true, //是否自动运行
        fixed: [',', ':', '.'], //
        start: '0'
    });
    // 动画

});
